package LexPortal.Structs2;

import com.opensymphony.xwork2.ActionSupport;

import LexPortal.DaoImpl.UserDaoImpl;
import LexPortal.Entity.*;

public class Register extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7985836651318188969L;

	public String execute() {
		try {
			UserDaoImpl impl = new UserDaoImpl();
			impl.Insert(user);
		} catch (Exception ex) {
			addFieldError("user.name",ex.getMessage());
			return "input";
		}
		return SUCCESS;
	}

	private User user;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
}
